﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.PWF
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.PWF;

    public class wf_pwf_detail_map : ClassMapping<wf_pwf_detail>
    {
        public wf_pwf_detail_map()
        {
            Id(x => x.r_id, map =>
            {
                map.Length(40);
                map.Column(wf_pwf_detail.Columns.r_id);
            });
            Property(x => x.is_valid, map => map.Column(wf_pwf_detail.Columns.is_valid));
            Property(x => x.create_date, map => map.Column(wf_pwf_detail.Columns.create_date));

            //费用评委费
            ManyToOne(x => x.this_wf_pwf, map =>
            {
                map.Column(wf_pwf_detail.Columns.n_id);
                map.NotNullable(false);
            });

            Property(x => x.order_flag, map => map.Column(wf_pwf_detail.Columns.order_flag));
            Property(x => x.pwdw, map =>
            {
                map.Length(200);
                map.Column(wf_pwf_detail.Columns.pwdw);
            });
            Property(x => x.pwfje, map =>
            {
                map.Column(wf_pwf_detail.Columns.pwfje);
            });
            Property(x => x.pwlx, map =>
            {
                map.Length(50);
                map.Column(wf_pwf_detail.Columns.pwlx);
            });
            Property(x => x.pwlxfs, map =>
            {
                map.Length(50);
                map.Column(wf_pwf_detail.Columns.pwlxfs);
            });
            Property(x => x.pwxm, map =>
            {
                map.Length(50);
                map.Column(wf_pwf_detail.Columns.pwxm);
            });

            //详细记录所属费用报账记录
            ManyToOne(x => x.this_wf_pwf, map =>
            {
                map.Column(wf_pwf_detail.Columns.n_id);
                map.NotNullable(false);
            });

            Table(wf_pwf_detail.TableName);

            //SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
